﻿package mortal.game.view.mainUI.smallMap.view.typeIconDataParser
{
    import Message.BroadCast.*;
    import Message.DB.Tables.*;
    import Message.Public.*;
    import extend.language.*;
    import mortal.game.cache.*;
    import mortal.game.resource.*;
    import mortal.game.resource.tableConfig.*;
    import mortal.game.scene3D.layer3D.utils.*;
    import mortal.game.scene3D.player.entity.*;
    import mortal.game.view.mainUI.smallMap.view.data.*;

    public class SmallMap_ArenaParser extends Object implements ISMallMapTyperIconDataParser
    {
        public static var instance:SmallMap_ArenaParser = new SmallMap_ArenaParser;

        public function SmallMap_ArenaParser()
        {
            return;
        }// end function

        public function chooseIcon(param1:IEntity, param2:Array) : void
        {
            var _loc_9:Boolean = false;
            var _loc_3:* = param1.entityInfo.entityInfo;
            var _loc_4:* = new SmallMapTypeIconData();
            _loc_4.x = param1.x2d;
            _loc_4.y = param1.y2d;
            _loc_4.name = "";
            _loc_4.tips = "";
            var _loc_5:* = Cache.instance.role.entityInfo;
            var _loc_6:* = _loc_5.force == _loc_3.force;
            var _loc_7:* = _loc_3.entityId.type == EEntityType._EEntityTypePlayer;
            var _loc_8:* = BossConfig.instance.getInfoByCode(_loc_3.code);
            if (_loc_8 && _loc_8.type == EBossType._EBossTypePlayerRobot)
            {
                _loc_9 = true;
            }
            var _loc_10:* = _loc_3.entityId.type == EEntityType._EEntityTypePet;
            var _loc_11:* = _loc_3.ownerEntityId && _loc_3.ownerEntityId.id != 0;
            if (param1 is PetPlayer)
            {
                return;
            }
            var _loc_12:* = _loc_3.entityId.type == EEntityType._EEntityTypeEscort;
            var _loc_13:* = EntityUtil.equal(_loc_3.ownerEntityId, _loc_5.entityId);
            if ((_loc_7 || _loc_9) && !EntityUtil.equal(_loc_3.entityId, _loc_5.entityId))
            {
                if (_loc_6)
                {
                    _loc_4.iconName = ImagesConst.MapPoint_FriendPoint;
                    _loc_4.tips = Language.getString(21277);
                }
                else
                {
                    _loc_4.iconName = ImagesConst.MapPoint_MovePoint;
                    _loc_4.tips = Language.getString(21278);
                }
                param2.push(_loc_4);
            }
            return;
        }// end function

    }
}
